<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./axios.min.js"></script>
    <script src="./vue.global.prod.js"></script>
</head>
<body>
    <div id="app">
        <button @click="doFilmFindByPage" >film/findByPage</button>
        <br>
        <input type="text" v-model="movieId">
        <button @click="doFilmOne" >film/movie</button>
        <br>
        <img style="width: 200px" :src="coverUrl" alt="">
    </div>
    <script>
        // http://10.0.6.157:8000/fc
        // /film/findByPage
        // /film/movie
        Vue.createApp({
            data() {
                return {
                    coverUrl: '',
                    movieId: '36328210',
                }
            },
            methods: {
                async doFilmFindByPage() {
                    console.log('doFilmFindByPage');
                    try {
                        const response = await axios.get('http://10.0.6.157:8000/fc/film/findByPage');
                        console.log('response:', response);

                        //服务器响应的数据
                        console.log('data:', response.data);
                    } catch (error) {
                        console.log('error:', error);
                    }
                },
                async doFilmOne() {
                    try {
                        const response = await axios.get('http://10.0.6.157:8000/fc/film/movie/' + this.movieId);
                        //服务器响应的数据
                        console.log('data:', response.data);
                        this.coverUrl = response.data.data.cover_url;
                    } catch (error) {
                        console.log('error:', error);
                    }
                }
            },
        }).mount('#app');

    </script>
</body>
</html>